package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * ClassName: SysStudent
 * Package: com.ruoyi.system.domain
 * Description: 学生信息对象
 *
 * @Author: blw
 * @Create: 2023/11/16 - 11:16
 * @Version: v1.0
 */
@TableName(value = "sys_student")
public class SysStudent implements Serializable {

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**编号 **/
    @TableId(type = IdType.AUTO)
    private Long studentId;

    /** 学生名称 **/
    @Excel(name = "学生名称")
    private String studentName;

    /**年龄 **/
    @Excel(name = "年龄")
    private Integer studentAge;

    /** 爱好(0代码 1音乐 2电影) */
    @Excel(name = "爱好")
    private String studentHobby;
    /**
     * 性别 (0男 1女 2未知)
     */
    @Excel(name = "性别",readConverterExp = "0=男,1=女,2=未知")
    private String studentSex;

    /**
     * 状态 (0正常 1停用)
     */
    @Excel(name = "状态",readConverterExp = "0=正常,1=停用")
    private String studentStatus;
    /**
     * 生日
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "生日",width = 30,dateFormat = "yyyy-MM-dd")
    private Date studentBirthday;

    public Long getStudentId() {
        return studentId;
    }

    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    @Xss(message = "用户账号不能包含脚本字符")
    @NotBlank(message = "学生名字不能为空")
    @Size(min = 0,max = 10,message = "学生名称不能超过10个字符")
    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public Integer getStudentAge() {
        return studentAge;
    }

    public void setStudentAge(Integer studentAge) {
        this.studentAge = studentAge;
    }

    public String getStudentHobby() {
        return studentHobby;
    }

    public void setStudentHobby(String studentHobby) {
        this.studentHobby = studentHobby;
    }

    public String getStudentSex() {
        return studentSex;
    }

    public void setStudentSex(String studentSex) {
        this.studentSex = studentSex;
    }

    public String getStudentStatus() {
        return studentStatus;
    }

    public void setStudentStatus(String studentStatus) {
        this.studentStatus = studentStatus;
    }

    public Date getStudentBirthday() {
        return studentBirthday;
    }

    public void setStudentBirthday(Date studentBirthday) {
        this.studentBirthday = studentBirthday;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("studentId",getStudentId())
                .append("studentName",getStudentName())
                .append("studentAge",getStudentAge())
                .append("studentHobby",getStudentHobby())
                .append("studentSex",getStudentSex())
                .append("studentStatus",getStudentStatus())
                .append("studentBirthday",getStudentBirthday())
                .toString();
    }
}
